<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page contentType="text/html;charset=utf-8"%>
<%@ page import="org.apache.commons.lang.StringUtils" %>
<% out.clear();
/*	
	更新记录：
		2013-01-25 取消对SmartUpload的使用，改用commons-fileupload组件。因为测试发现SmartUpload有内存泄露的问题。
*/
//String path = request.getContextPath();
//String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String clientCookie = request.getHeader("Cookie");
%>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>WordPaster form wangEditor</title>
	<!--<script type="text/javascript" src="jquery/jquery-1.4.4.min.js"></script>-->
    <script type="text/javascript" src="WordPaster/js/json2.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="WordPaster/js/jquery-1.4.min.js" charset="utf-8"></script>
	<script type="text/javascript" src="wangEditor.min.js"></script>
    <link type="text/css" rel="Stylesheet" href="WordPaster/css/w.css"/>
    <link type="text/css" rel="Stylesheet" href="WordPaster/js/jquery-ui-1.8.4/themes/base/jquery-ui.css" />
    <script type="text/javascript" src="WordPaster/js/jquery-ui-1.8.4/ui/jquery-ui.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="WordPaster/js/w.edge.js" charset="utf-8"></script>
    <script type="text/javascript" src="WordPaster/js/w.app.js" charset="utf-8"></script>
    <script type="text/javascript" src="WordPaster/js/w.file.js" charset="utf-8"></script>
    <script type="text/javascript" src="WordPaster/js/w.jqueryui.js" charset="utf-8"></script>
    <script type="text/javascript" src="WordPaster/js/wang.js" charset="utf-8"></script>
    <style type="text/css">
        .wordpaster {
            background: transparent url(WordPaster/paster.png) no-repeat;
            width: 32px !important;
            height: 16px !important;
            margin: 2px 0 0 2px;
            z-index: 9999;
        }

        .netpaster {
            background: transparent url(WordPaster/net.png) no-repeat;
            width: 32px !important;
            background-position: 3px 2px;
        }

        .pptimport {
            background: transparent url(WordPaster/ppt1.png) no-repeat;
            width: 32px !important;
            height: 16px !important;
            margin: 2px 0 0 2px;
            z-index: 9999;
        }

        .pdfimport {
            background: transparent url(WordPaster/pdf.png) no-repeat;
            width: 32px !important;
            height: 16px !important;
            margin: 2px 0 0 2px;
            z-index: 9999;
        }
    </style>
</head>
<body>
	<div style=" font-size:medium; line-height:130%;">
		<p>演示方法：</p>
		<ul style="list-style-type:decimal;">
			<li>打开Word文档，复制多张图片，然后在编辑器中按 Ctrl+V 粘贴，编辑器将自动上传所有图片。</li>
			<li>复制电脑中任意图片文件，然后点击编辑器中的图片粘贴按钮。</li>
			<li>通过QQ或其它软件截屏，复制图片，然后点击编辑器中的图片粘贴按钮。</li>
		</ul>
		<p>相关问题：</p>
		<ul style="list-style-type:decimal;">
			<li><a target="_blank" href="http://www.ncmem.com/webapp/wordpaster/pack.aspx">安装插件</a></li>
			<li><a target="_blank" href="https://www.kancloud.cn/wangfupeng/wangeditor3/332599">wangEditor3教程</a></li>
		</ul>
	</div>
	<div id="editor">
        <p>欢迎使用 <b>WordPaster for wangEditor3</b> 插件</p>
    </div>
    <div id="wdpst"></div>
	<script type="text/javascript" language="javascript">
		var pos = window.location.href.lastIndexOf("/");
        var api = [
            window.location.href.substr(0, pos + 1),
            "upload.jsp"
        ].join("");
		WordPaster.getInstance({
			//上传接口：http://www.ncmem.com/doc/view.aspx?id=d88b60a2b0204af1ba62fa66288203ed
	        PostUrl:api,
			//为图片地址增加域名：http://www.ncmem.com/doc/view.aspx?id=704cd302ebd346b486adf39cf4553936
            ImageUrl: "",
            //设置文件字段名称：http://www.ncmem.com/doc/view.aspx?id=c3ad06c2ae31454cb418ceb2b8da7c45
            FileFieldName: "file",
            //提取图片地址：http://www.ncmem.com/doc/view.aspx?id=07e3f323d22d4571ad213441ab8530d1
            ImageMatch: '',
	        Cookie: '<%=clientCookie%>',
	        ui:{render:"wdpst"}
	    });//加载控件
		
        var E = window.wangEditor;
        var edt = new E('#editor');
        edt.customConfig.zIndex = 100; 
        // 或者 var editor = new E( document.getElementById('editor') )
        edt.create();
        E.wordpaster.init('#editor',edt);
    </script>
</body>
</html>